package com.yanqu.road.entity.tradewar;

import com.alibaba.fastjson.JSON;
import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.player.UserBaseInfo;

import java.util.Objects;

public class UserTradeWarRecord extends DataObject {

	private long userId;

	private String recordUid;

	private int battleType;

	private long enemyUserId;

	private UserBaseInfo enemyBaseData = new UserBaseInfo();

	private long enemyScore;

	private int killPatronsCount;

	private int loseScore;

	private long recordTime;

	private boolean isBattle;

	private int activityId;

	public long getUserId() {
		return userId;
	}

	public void setUserId(long userId) {
		if(this.userId != userId) {
			this.userId = userId;
			setUpdateOption();
		}
	}

	public String getRecordUid() {
		return recordUid;
	}

	public void setRecordUid(String recordUid) {
		if(!Objects.equals(this.recordUid, recordUid)) {
			this.recordUid = recordUid;
			setUpdateOption();
		}
	}

	public int getBattleType() {
		return battleType;
	}

	public void setBattleType(int battleType) {
		if(this.battleType != battleType) {
			this.battleType = battleType;
			setUpdateOption();
		}
	}

	public long getEnemyUserId() {
		return enemyUserId;
	}

	public void setEnemyUserId(long enemyUserId) {
		if(this.enemyUserId != enemyUserId) {
			this.enemyUserId = enemyUserId;
			setUpdateOption();
		}
	}

	public UserBaseInfo getEnemyBaseData() {
		return enemyBaseData;
	}

	public String getEnemyBaseDataJsonStr(){
		if(null == enemyBaseData){
			return "{}";
		}else {
			return JSON.toJSONString(enemyBaseData);
		}
	}

	public void setEnemyBaseData(UserBaseInfo enemyBaseData) {
		this.enemyBaseData = enemyBaseData;
		setUpdateOption();
	}

	public long getEnemyScore() {
		return enemyScore;
	}

	public void setEnemyScore(long enemyScore) {
		if(this.enemyScore != enemyScore) {
			this.enemyScore = enemyScore;
			setUpdateOption();
		}
	}

	public int getKillPatronsCount() {
		return killPatronsCount;
	}

	public void setKillPatronsCount(int killPatronsCount) {
		if(this.killPatronsCount != killPatronsCount) {
			this.killPatronsCount = killPatronsCount;
			setUpdateOption();
		}
	}

	public int getLoseScore() {
		return loseScore;
	}

	public void setLoseScore(int loseScore) {
		if(this.loseScore != loseScore) {
			this.loseScore = loseScore;
			setUpdateOption();
		}
	}

	public long getRecordTime() {
		return recordTime;
	}

	public void setRecordTime(long recordTime) {
		if(this.recordTime != recordTime) {
			this.recordTime = recordTime;
			setUpdateOption();
		}
	}

	public boolean isBattle() {
		return isBattle;
	}

	public void setBattle(boolean battle) {
		if(this.isBattle != battle) {
			isBattle = battle;
			setUpdateOption();
		}
	}

	public int getActivityId() {
		return activityId;
	}

	public void setActivityId(int activityId) {
		if(this.activityId != activityId) {
			this.activityId = activityId;
			setUpdateOption();
		}
	}
}
